home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
asmutil
/
asm_n_z.zip
/
PARCHK.ASM
< prev
next >
Wrap
Assembly Source File
|
1980-01-01
|
31KB
|
580 lines
page ,132
title PARCHK.ASM -- Replacement for IBM-PC ROM BIOS parity error routines
;*****************************************************************************
;*
;* copyright(C) 1984 Skip Gilbrech (CIS 71445,534)
;* 90 Lexington Ave. #10-G
;* New York, NY 10016
;* 212-685-0551
;*
;* This program may be freely copied/altered for any non-commercial
;* purpose but may not be sold or used in any way as part of any
;* profit-making venture without permission of the author.
;*
;* author = skip gilbrech
;* date written = 02/19/84
;*
;* environment:
;* system = ibm pc (dos 2.0 - but should work on any version)
;* processor = microsoft 8086 macro assembler
;*
;* USAGE: PARCHK /R (or) /D
;* /R = Report all errors which occur
;* /D = Disable reporting after an error
;*
;* PARCHK is a resident program which replaces the ibm pc rom-bios NMI
;* (non-maskable interrupt) handler.
;*
;* It will report any memory parity errors to the operator, but will allow
;* the system to continue running. An installation option lets you choose
;* whether or not to receive continued reports after the first error for
;* a particular channel (system memory or i/o channel). Regardless of the
;* option chosen, however, the first error for each channel will always be
;* reported.
;*
;* I wrote PARCHK mostly because of the frustration I felt a few days ago
;* when the message 'PARITY CHECK 2' appeared suddenly on my pc's screen.
;* I had seen the message a couple of times before, but never at a time
;* like this: The machine contained over 3 hours of unsaved work, and I
;* knew there was not a thing I could do about it, since the parity error
;* handler in the rom-bios simply disables interrupts and issues a HLT
;* instruction to the cpu.
;*
;* I have also read a number of messages on the Compuserve IBM-PC SIG
;* which indicate that I'm not the only one to have had this experience.
;*
;* IBM's approach in the rom-bios makes some sense. The condition of
;* system ram is unknown following a parity error, and continued operation
;* MIGHT result in all sorts of horrible consequences, i.e., hopelessly
;* corrupted data on disk, etc.
;*
;* On my system, though, memory parity errors have been extremely rare,
;* and have probably resulted from a slight glitch on the power line,
;* static, etc. I really have no idea what would have happened if I
;* had been able to continue operation in those cases. However, I have
;* crashed the system often enough (most of the time probably executing
;* random data or instructions somewhere) to have some confidence that the
;* most likely, if not the only possible, outcome of a processor gone wild
;* is simply a dead machine, i.e. interrupt vectors wiped out, etc., which
;* must be powered-down and up.
;*
;* So, for me, the risks of continued operation -- at least until important
;* data in ram are saved -- seem relatively small when balanced against
;* the CERTAINTY of lost data when the rom-bios routine gets control: If
;* data HAS been corrupted, at least there remains the chance of later
;* being able to examine and possibly fix it.
;*
;* Continued operation still DOES represent a risk, however, especially
;* if parity errors occur often, since that probably indicates a serious
;* hardware problem somewhere in the system.
;*
;* If you don't want to take that risk, please don't use this program,
;* as I can't, of course, take responsibility for any damage, real or
;* otherwise, it may cause.
;*
;* On the other hand, if PARCHK is ever responsible for saving a multi-
;* million dollar oil deal which would otherwise have fallen victim to
;* an unruly parity bit...... (suffice it to say that I would deem it
;* an honor to allow you to express your gratitude)
;*
;* The resident part of this code, by the way, uses up a little over 1K
;* of ram. Most of that space is taken up by routines which save the
;* current screen, write the error message, and then restore the screen.
;* I made no particular effort to make that code as compact as possible,
;* so, if space is at a premium, and/or you like doing such things, please
;* feel free to squeeze and optimize to your heart's content... As an
;* alternative, if you don't mind junk on your screen, it would be fairly
;* easy to replace most of the error message code with a short routine which
;* uses the rom-bios 'write teletype' function to print a message, but
;* doesn't waste any memory by saving the screen. It's probably best not
;* to use dos functions here, since a parity error can be reported at any
;* time, even with interrupts disabled and/or while in the middle of a dos
;* routine -- and pc/ms-dos is notoriously non-reentrant.
;*
;**************************************************************************
page
;**************************************************************************
;*
;* constants
;*
;**************************************************************************
; general equates:
false equ 0
true equ not false
cr equ 0dh ; carriage return
lf equ 0ah ; line feed
bell equ 7 ; ascii bell
spc equ ' ' ; ascii space, blank
tab equ 9 ; ascii horizontal tab
; program equates:
dosint equ 21h ; interrupt number for dos functions
prt_str equ 9 ; dos print string function
get_vers equ 30h ; dos get version number function
get_int_vec equ 35h ; dos 2.0 get interrupt vector function
set_int_vec equ 25h ; dos set interrupt vector function
vidint equ 10h ; bios video interrupt number
vid_state equ 15 ; bios - get video state
read_curs_pos equ 3 ; bios - read cursor position
set_curs_pos equ 2 ; bios - set cursor position
set_curs_type equ 1 ; bios - set cursor type
write_teletype equ 14 ; bios - write teletype to display
read_ac equ 8 ; bios - read att/char at curs. position
write_ac equ 9 ; bios - write att/char at curs. position
disp_row equ 10 ; row to display error msg
disp_col equ 25 ; col to display error msg
num_lines equ 3 ; number of text lines to display
normal equ 7 ; normal (white on black) vid. attrib.
reverse_blink equ 0f0h ; reverse-video blinking vid. attrib.
reverse equ 70h ; reverse-video (no blink)
; hardware specific equates:
port_a equ 60h ; system board 8255 port a address
port_b equ 61h ; system board 8255 port b address
port_c equ 62h ; system board 8255 port c address
par_err_mask equ 0c0h ; mask to test for any parity error
par_ch1_mask equ 10000000b ; mask to test for system board parity error
par_ch2_mask equ 01000000b ; mask to test for i/o channel parity error
disa_ch1_mask equ 00010000b ; mask to disable system board parity checking
enab_ch1_mask equ 11101111b ; mask to enable system board parity checking
disa_ch2_mask equ 00100000b ; mask to disable i/o channel parity checking
enab_ch2_mask equ 11011111b ; mask to enable i/o channel parity checking
nmi_int_no equ 2 ; NMI interrupt number
nmi_port equ 0a0h ; NMI control port
enable_nmi equ 80h ; value to output to enable NMI
disable_nmi equ 0 ; value to output to disable NMI
;**************************************************************************
int_vecs segment at 0
int_vecs ends
page
;**************************************************************************
cseg segment
assume cs:cseg,ds:cseg
org 80h ; for processing command line parms.
cmd_ct label byte ; number of chars. in command line
org 100h